<template>
  <div>
    <template>
      <el-table :data="Evaluation" style="width: 100%" max-height="650px">
        <el-table-column prop="WorkerName" label="职工名称" width="300" align="center"></el-table-column>
        <el-table-column prop="CourseName" label="课程名称" width="300" align="center"></el-table-column>
        <el-table-column label="分值" width="300" align="center">
          <template
            slot-scope="scope"
          >{{scope.row.WorkerEvaluationOption1+scope.row.WorkerEvaluationOption2+scope.row.WorkerEvaluationOption3+scope.row.WorkerEvaluationOption4+scope.row.WorkerEvaluationOption5}}</template>
        </el-table-column>
        <el-table-column label="查看" width="300" align="center">
          <template
            slot-scope="scope"
          >
        </el-table-column>
      </el-table>
    </template>
  </div>
</template>

<script>
export default {
  data() {
    return {
      Evaluation: [],
      user: ""
    };
  },
  created() {
    this.GetWorkerEvaluation();
  },
  mounted() {},
  methods: {
    GetWorkerEvaluation() {
      this.user = JSON.parse(sessionStorage.getItem("user"));
      this.$axios({
        method: "get",
        url: this.$api.GetWorkerEvaluation,
        data: {},
        params: {
          token: this.user.Token
        }
      }).then(res => {
        console.log(res);
        res.data.message.forEach(element => {
          element.WorkerEvaluationOption1 = Number(
            element.WorkerEvaluationOption1
          );
          element.WorkerEvaluationOption2 = Number(
            element.WorkerEvaluationOption2
          );
          element.WorkerEvaluationOption3 = Number(
            element.WorkerEvaluationOption3
          );
          element.WorkerEvaluationOption4 = Number(
            element.WorkerEvaluationOption4
          );
          element.WorkerEvaluationOption5 = Number(
            element.WorkerEvaluationOption5
          );
        });
        this.Evaluation = res.data.message;
      });
    }
  }
};
</script>

<style scoped>
</style>
